<template>
	<view>
		<!-- 沟通过 -->
<view class="jobCard" @click="jobDetail(item)" v-for="(item,index) in state.list" :key="index">
<!-- 			<view class="jcName" v-if="showcompnay">
				<image :src="item.companyLogo" mode=""></image>
				<text>{{item.job.jobName}}</text>
			</view> -->
			<view class="jcType">
				<text>{{item.job.jobName}}</text>
				<text v-if="item.job.comprehensiveSalaryType == 1">{{item.job.comprehensiveSalaryStart}}-{{item.job.comprehensiveSalaryEnd}}k ·{{item.job.bonus}}薪</text>
				<text v-else>面议</text>
			</view>
			<view class="jcAddress">
				期望职位 ：{{item.job.jobCategoryName}}
				<!-- ·全职 -->
			</view>
			<view class="jcContent u-line-3" v-if="pageType !='myInterview'">{{item.job.jobDescription}}</view>
			<view class="jcTime">{{item.lastTime}}</view>
		</view>

	</view>
</template>

<script setup>
	import jobCard from "@/components/job-card.vue"
	import { ref,reactive,getCurrentInstance} from 'vue'
	import { onLoad } from '@dcloudio/uni-app';
	import {userStore} from '@/pinia';
	import {useRouter} from 'uni-mini-router'
	const userStoreInfo = userStore();
	const router = useRouter()
	const {proxy} = getCurrentInstance()

	let state = reactive({
		id:'',
		scrollJin:[], //招聘分类
		currentObj:{},//当前选中的分类
		list:[],//招聘分类下的岗位
	})
	
	//获取求职记录分页列表查询
	const meiyeRecruitJobLog2List = () => {
		let params = {
			status:0
		}
		proxy.$req('GET', proxy.$api.imInteraction3, params).then((res) => {
			console.log(res);
			if(res.code === 200){
				let arr = []
				// res.result.records.forEach((el,i)=>{
				// 	console.log(el)
				// 	 Object.keys(el).forEach(v=>{
				// 		let newArr = []
				// 		res.result.records[i][v].forEach(val=>{
				// 			newArr.push(val.job)
				// 		})
				// 		res.result.records[i][v] = res.result.records[i][v]
				// 		let obj ={
				// 		 	time:v,
				// 			data:newArr
				// 		}
				// 		arr.push(obj)
				// 	})
				// })
				state.list = res.result.records
			}
		})
	}
	
	onLoad(()=>{
		meiyeRecruitJobLog2List()
	})

</script>

<style>
	page{
		background:#f6f6f6;
		height:100%;
	}
	.page-main{
		.time{
			padding:0 24rpx;
		}
	}
	.jobCard-box{
		height:100%;
		padding:0 24rpx;
		
	}
	.jobCard {
		width:90%;
		
		/* // width: calc(92% - 40rpx); */
		min-height: 328rpx;
		overflow: hidden;
		box-sizing: border-box;
		border: 2rpx solid #fff;
		margin: 30rpx auto;
		padding: 24rpx;
		background:#fff;
		border-radius: 24rpx;
		box-shadow: 8rpx 8rpx 32rpx 0rpx rgba(0, 0, 0, 0.04);
		
	
		.jcName {
			display: flex;
			align-items: center;
			image {
				width: 50rpx;
				height: 50rpx;
				border-radius: 50rpx;
				margin-right: 20rpx;
			}
			text{
				font-size: 24rpx;
			}
		}
	
		.jcType {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin: 24rpx 0 24rpx 0;
			
			text:nth-child(1) {
				font-size: 32rpx;
				font-weight: 600;
			}
	
			text:nth-child(2) {
				font-size: 32rpx;
				color: rgba(203, 100, 94, 1);
				font-weight: 700;
			}
		}
	
		.jcAddress {
			font-size: 24rpx;
			margin-bottom:12rpx;
			color: rgba(0, 0, 0, 0.45);
			white-space: nowrap;
			line-height: 34rpx;
			
		}
	
		.jcContent {
			color: rgba(0, 0, 0, 0.65);
			font-size: 28rpx;
			line-height: 44rpx;
		}
	
		.jcTime {
			text-align: right;
			margin-top: 10rpx;
			
			color: rgba(0, 0, 0, 0.45);
			font-size: 24rpx;
		}
	}
</style>
